import './assets/main.css'

import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
import Vant from 'vant'
import 'vant/lib/index.css'

// 配置API基础URL
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL || 'http://localhost:5175'
console.log('API Base URL:', apiBaseUrl)

// 路由配置
const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: () => import('./views/LoginView.vue') },
  { path: '/home', component: () => import('./views/HomeView.vue') },
  { path: '/hospital-list', component: () => import('./views/HospitalListView.vue') },
  { path: '/order-application', component: () => import('./views/OrderApplicationView.vue') },
  { path: '/self-service-notice', component: () => import('./views/SelfServiceNoticeView.vue') },
  { path: '/order-confirm', component: () => import('./views/OrderConfirmView.vue') },
  { path: '/order-record', component: () => import('./views/OrderRecordView.vue') },
  { path: '/order-pay', component: () => import('./views/OrderPayView.vue') },
  { path: '/order-detail', component: () => import('./views/OrderDetailView.vue') }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

const app = createApp(App)
app.use(router)
app.use(Vant)
app.mount('#app')
